<template>
  <div class="app-container">
    <el-tabs
      class="table-form-detail"
      :value="'1'"
      type="border-card"
      @tab-click="handleClick"
    >
      <el-tab-pane label="巡检项" name="1"
        ><ProgramItems v-if="show1"
      /></el-tab-pane>
      <el-tab-pane label="巡检项分组" name="2"
        ><ProgramGroups v-if="show2"
      /></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import ProgramItems from "./component/addProgram/programItems";
import ProgramGroups from "./component/addProgram/programGroups";
export default {
  components: { ProgramItems, ProgramGroups },
  data() {
    return {
      show1: true,
      show2: false,
      activeName: 1
    };
  },
  methods: {
    handleClick(tab) {
      console.log(tab);
      if (tab.name == 1) {
        this.show1 = true;
        this.show2 = false;
      } else if (tab.name == 2) {
        this.show2 = true;
        this.show1 = false;
      }
    }
  }
};
</script>
<style></style>
